
// import { ADDCOUNTER, SUBCOUNTER } from './actionType'
import * as actionTypes from './actionType'

const initialState = {
    counter: 10
}


function reducer(state = initialState, action) {
    switch (action.type) {
        case actionTypes.ADDCOUNTER:
            return { counter: state.counter + action.counter }
        case actionTypes.SUBCOUNTER:
            return { counter: state.counter + action.counter }
        default:
            return state;
    }
}

export default reducer